package priv.ln.encapsulation.exer3;

import java.util.Scanner;

/**
 * ClassName: EmployeeTest
 * Package: priv.ln.encapsulation.exer3
 * Description:
 *
 * @Author 辣辣
 * @Create 2024/6/21 17:18
 * @Version 1.0
 */
public class EmployeeTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Employee[] employees = new Employee[2];

        //添加员工
        for (int i = 0; i < employees.length; i++) {
            employees[i] = new Employee();
            System.out.println("----------添加第" + (i + 1) + "个员工-----------");
            System.out.print("姓名：");
            employees[i].setName(sc.next());
            System.out.print("性别：");
            employees[i].setGender(sc.next().charAt(0));
            System.out.print("年龄：");
            employees[i].setAge(sc.nextInt());
            System.out.print("电话：");
            employees[i].setPhoneNumber(sc.next());
        }

        System.out.println("--------------员工列表------------");
        System.out.println("编号\t姓名\t性别\t年龄\t电话");
        for (int i = 0; i < employees.length; i++) {
            System.out.println((i + 1) + "\t" + employees[i].getInfo());
        }
        System.out.println("-----------员工列表完成--------------");
    }
}
